package com.zgxl.common.es;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.List;

@RestController
@RequestMapping(value = "/es/test")
public class TestController {
    @Autowired
    private ElasticConnUtil elasticConnUtil;

    @RequestMapping("addCard")
    @ResponseBody
    public List mssg(@RequestParam("type") int type, @RequestParam("esId") String esId, @RequestParam("objId") String objId) {
        try {
            return elasticConnUtil.getTransportClient().transportAddresses();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    @RequestMapping("addCard2")
    public Mono<String> sayHelloWorld() {
        return Mono.just("sc-provider receive : " +12);
    }
}
